/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.web.misc.cg.extractor.impl;

/**
 * Java Doc 映射注解
 *
 * @author vacoor
 */
public interface JavaMappingAnnotation {
    String TABLE = "Table";
    String ID = "Id";
    String COLUMN = "Column";
    String COLUMN_NAME = "name";
    String COLUMN_UNIQUE = "unique";
    String COLUMN_NULLABLE = "nullable";
    String COLUMN_INSERTABLE = "insertable";
    String COLUMN_UPDATABLE = "updatable";
    String COLUMN_LENGTH = "length";
    String COLUMN_SCALE = "scale";

    String REL_FETCH = "fetch";         // 是否抓去关联对象
    String REL_FETCH_LAZY = "lazy";
    String REL_FETCH_EAGER = "eager";
    String REL_OPTIONAL = "optional";   // 关联对象是否是可选的, 如果是则使用 LEFT JOIN, 否则 INNER JOIN
    /**
     * 关联列
     * OneToOne: 当当前实体为关系维护方时(mappedBy="")使用该值作为关联列
     * OneToMany: Many 关联 One 的连接列
     * ManyToOne: Many 关联 One 的连接列
     * ManyToMany: 中间表(Many)关联当前实体(One)的连接列
     */
    String REL_JOIN_COLUMN = "joinColumn";
    String REL_JOIN_TABLE = "JoinTable";
    String REL_INVERSE_JOIN_COLUMN = "inverseJoinColumn";
    String REL_MAPPED_BY = "mappedBy";  // 双向关联中, 关系由关联实体维护, 关联实体通过给定字段关联当前实体(去对方给定属性中查找配置)

    String ONE_TO_ONE = "OneToOne";
    String MANY_TO_ONE = "ManyToOne";
    String ONE_TO_MANY = "OneToMany";
    String MANY_TO_MANY = "ManyToMany";
}
